package com.data_structure_algorithm.data_structure.hash;

/**
 * @Authror PABLO
 * @Date 2022/3/28 15:45
 * @Desc  哈希表客户端
 */
public class Client {

    public static void main(String[] args) {
        HashTable hashTable = new HashTable(16);
        add(hashTable);
        hashTable.print();
        hashTable.update(new Emp(1,"呼保义"));
        System.out.println();
        System.out.println("执行更新后-------------");
        hashTable.print();
        hashTable.remove(new Emp(10,"柴进"));
        System.out.println();
        System.out.println("执行删除后-------------");
        hashTable.print();
        hashTable.find(100);
        System.out.println();
        System.out.println("执行查找后-------------");
        hashTable.print();
       // Arrays.copyOf()
    }

    public static void add(HashTable hashTable){
        hashTable.add(new Emp(4,"公孙胜"));
        hashTable.add(new Emp(5,"关胜"));
        hashTable.add(new Emp(6,"林冲"));
        hashTable.add(new Emp(7,"秦明"));
        hashTable.add(new Emp(8,"呼延灼"));
        hashTable.add(new Emp(9,"花荣"));
        hashTable.add(new Emp(10,"柴进"));
        hashTable.add(new Emp(11,"李应"));
        hashTable.add(new Emp(1,"宋江"));
        hashTable.add(new Emp(2,"卢俊义"));
        hashTable.add(new Emp(3,"吴用"));

        hashTable.add(new Emp(12,"朱仝"));
        hashTable.add(new Emp(13,"鲁智深"));
        hashTable.add(new Emp(14,"武松"));
        hashTable.add(new Emp(15,"董平"));
        hashTable.add(new Emp(16,"张清"));
        hashTable.add(new Emp(17,"杨志"));
        hashTable.add(new Emp(18,"徐宁"));
        hashTable.add(new Emp(19,"索超"));
        hashTable.add(new Emp(35,"解宝"));
    }
}
